home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / WithVectorsToHeaven.lha / With Vectors To Install / Install next >
Text File  |  2001-03-27  |  4KB  |  224 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")    ;name of the readme file
  4.  
  5. (procedure P_MakeImages
  6.  
  7.   ;the following lines must be copied and adjusted for multiple disk images
  8.  
  9.   (set #CI_disknum 1)
  10.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  11.   (set #CI_disklen 901120)
  12.   (set #CI_skiptrk -1)
  13.   (P_CreateImage)
  14.  
  15. )
  16.  
  17. ;****************************
  18. ;----------------------------
  19. ; checks if given program is installed, if not abort install
  20. ; #program - to check
  21.  
  22. (procedure P_ChkRun
  23.   (if
  24.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  25.     ("")
  26.     (abort 
  27.       (cat
  28.     "You must install \"" #program "\" first!\n"
  29.     "It must be accessible via the path.\n"
  30.     "You can find it in the WHDLoad package."
  31.       )
  32.     )
  33.   )
  34. )
  35.  
  36. ;----------------------------
  37. ; Create Image using DIC
  38. ; #dest        - path to save image in
  39. ; #CI_disknum  - number of the disk image to create
  40. ; #CI_diskname - label of the disk
  41. ; #CI_disklen  - length of disk image to create
  42. ; #CI_skiptrk  - track to skip, -1 means no skip
  43. ; #CI_drive    - drive to create image from
  44.  
  45. (procedure P_CreateImage
  46.   (message
  47.     (cat
  48.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  49.     "(make sure it's the right disk because it will not be checked)"
  50.     )
  51.   )
  52.   (if
  53.     (>= #CI_skiptrk 0)
  54.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  55.     (set #option "")
  56.   )
  57.   (if
  58.     (= 0
  59.       (run 
  60.         (cat
  61.           "cd \"" #dest "\"\n"
  62.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  63.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  64.         )
  65.       )
  66.     )
  67.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  68.     (abort "\"DIC\" has failed to create a diskimage")
  69.   )
  70. )
  71.  
  72. ;****************************
  73.  
  74. (if
  75.   (exists #readme-file)
  76.   (if
  77.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  78.     ("")
  79.     (run ("SYS:Utilities/More %s" #readme-file))
  80.   )
  81. )
  82.  
  83. (set #program "WHDLoad")
  84. (P_ChkRun)
  85.  
  86. (set #program "DIC")
  87. (P_ChkRun)
  88.  
  89. ; in expert mode ask for source drive
  90. (if
  91.   (= @user-level 2)
  92.   (
  93.     (set #CI_drive
  94.       (askchoice
  95.     (prompt "Select source drive for diskimages")
  96.     (default 0)
  97.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  98.     (help @askchoice-help)
  99.       )
  100.     )
  101.     (select #CI_drive
  102.       (set #CI_drive "DF0:")
  103.       (set #CI_drive "DF1:")
  104.       (set #CI_drive "RAD:")
  105.       (set #CI_drive
  106.         (askstring
  107.           (prompt "Select source drive for diskimages")
  108.           (default "DF0:")
  109.           (help @askstring-help)
  110.         )
  111.       )
  112.     )
  113.   )
  114.   (set #CI_drive "DF0:")
  115. )
  116.  
  117. (set @default-dest
  118.   (askdir
  119.     (prompt 
  120.       (cat
  121.     "Where should \"" @app-name "\" be installed?\n"
  122.     "A drawer \"" @app-name "\" will be automatically created."
  123.       )
  124.     )
  125.     (help @askdir-help)
  126.     (default @default-dest)
  127.     (disk)
  128.   )
  129. )
  130. (set #dest (tackon @default-dest @app-name))
  131. (if
  132.   (exists #dest)
  133.   (
  134.     (set #choice
  135.       (askbool
  136.         (prompt
  137.           (cat
  138.             "\nDirectory \"" #dest "\" already exists.\n"
  139.             "Should it be deleted?"
  140.           )
  141.         )
  142.         (default 1)
  143.         (choices "Delete" "Skip")
  144.         (help @askbool-help)
  145.       )
  146.     )
  147.     (if
  148.       (= #choice 1)
  149.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  150.     )
  151.   )
  152. )
  153. (makedir #dest
  154.   (help @makedir-help)
  155.   (infos)
  156. )
  157.  
  158. ;----------------------------
  159.  
  160. (copyfiles
  161.   (help @copyfiles-help)
  162.   (source ("%s.Slave" @app-name))
  163.   (dest #dest)
  164. )
  165. (if
  166.   (exists ("%s.newicon" @app-name))
  167.   (set #icon
  168.     (askchoice
  169.       (prompt "\nWhich icon would you like to install?\n")
  170.       (default 0)
  171.       (choices "Normal" "NewIcon")
  172.       (help @askchoice-help)
  173.     )
  174.   )
  175.   (set #icon 0)
  176. )
  177. (select #icon
  178.   (set #icon ("%s.inf" @app-name))
  179.   (set #icon ("%s.newicon" @app-name))
  180. )
  181. (copyfiles
  182.   (help @copyfiles-help)
  183.   (source #icon)
  184.   (newname ("%s.info" @app-name))
  185.   (dest #dest)
  186. )
  187. (tooltype
  188.   (dest (tackon #dest @app-name))
  189.   (settooltype "Slave" ("%s.Slave" @app-name))
  190.   (settooltype "PreLoad" "")
  191.   (setdefaulttool "WHDLoad")
  192.   (setstack 8192)
  193.   (noposition)
  194. )
  195. (if
  196.   (exists #readme-file)
  197.   (copyfiles
  198.     (help @copyfiles-help)
  199.     (source #readme-file)
  200.     (dest #dest)
  201.   )
  202. )
  203. (if
  204.   (exists ("%s.info" #readme-file))
  205.   (
  206.     (copyfiles
  207.       (help @copyfiles-help)
  208.       (source ("%s.info" #readme-file))
  209.       (dest #dest)
  210.     )
  211.     (tooltype
  212.       (dest (tackon #dest #readme-file))
  213.       (noposition)
  214.     )
  215.   )
  216. )
  217.  
  218. (P_MakeImages)
  219.  
  220. ;----------------------------
  221.  
  222. (exit)
  223.  
  224.